<?
include_once('../conn.php');
include_once('../include/func.php');
include("../user_check.php") ;
class catalogue{
	var $tid;
	function __construct($tid){
		$this->tid=$tid;
		}
		function arr_father(){
			global $db; global $tablepre;
			$arr_type_list = $db->select("SELECT tid,father FROM `".tablepre."stock_type` where father = ".$this->tid."");
			for($i=0;$i<count($arr_type_list);$i++){
				//
				$arr .= $arr_type_list[$i][0].',';
			}
			return $arr=substr($arr,0,-1);
		}
		function loop_father(){
			global $db; global $tablepre;
			$arr_type_list = $db->select("SELECT tid,father FROM `".tablepre."stock_type` where father in (".$this->arr_father().")");
			for($i=0;$i<count($arr_type_list);$i++){
				$arr .= $arr_type_list[$i][0].',';
			}
			return $arr=substr($arr,0,-1);
			}
			
	}
	


?>